{* $Id$ *}
{include_core file="admin/lib/header.html" title="播放单管理"}
  <div class="page-header border-bottom clearfix">
    <h2 class="left">播放单管理<span>在这里对播放单进行管理</span></h2>
    <a href="{AnUrl('play_list/admin/add')}" class="btn btn-success btn-sm right">添加播放单</a>
  </div>
  <div class="search-form js_advancedForm">
    <form action="{AnUrl('play_list/admin')}" method="get" class="js_orderSearchForm">
      <input type="hidden" name="status" value="{$status}">
      <!-- <input type="hidden" name="type" value="{$type}"> -->
      <p>
        <label for="" class="search-f-label">播放单名称：</label>
        <input type="text" class="search-f-ipt1" name="search_filter[title]" value="{$search_filter.title}">
      </p>
      <p>
      <label for="" class="search-f-label">添加时间：</label>
        <input type="text" class="search-f-ipt1 search-f-ipt2" name="search_filter[start_date]" value="{$search_filter.start_date}" id="startDate">
        <span class="search-f-line"></span>
        <input type="text" class="search-f-ipt1 search-f-ipt2" name="search_filter[end_date]" value="{$search_filter.end_date}" id="stopDate">
      </p>
      <p><label for="" class="search-f-label"></label><button type="submit" class="btn btn-success btn-xs js_searchBtn">搜索</button></p>
    </form>
  </div>
  <!--start:列表-->
  <table class="list-table goods-table">
    <caption>按状态：
    <a href='{AnUrl("play_list/admin?status=1")}' {if $status == 1} class="label label-primary" {else} class="label label-default" {/if}>正常</a>
    <a href='{AnUrl("play_list/admin?status=0")}' {if $status == 0} class="label label-primary" {else} class="label label-default" {/if}>已删除</a>
    </caption>
    <thead>
      <tr>
        <th style="width:20px;"><input type="checkbox" class="selectAll"></th>
        <th style="width:100px;">播放单名称</th>
        <th style="width:80px;">播放地区</th>
        <th style='width:130px;'>开始播放时间</th>
        <th style='width:130px;'>结束播放时间</th>
        <th style="width:130px;">添加时间</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
        {foreach $play_list as $k=>$v}
          <tr id="dataList{$v.id}">
              <td><input type="checkbox" class="listSelect"></td>
              <td>{$v.title}</td>
              <td>{if $v.province}{$v.province}{$v.city}{else}全国{/if}</td>
              <td>{time_format($v.start_time)}</td>
              <td>{time_format($v.stop_time)}</td>
              <td>{time_format($v.add_time)}</td>
              <td>
                {if $status}
                  <a href='{AnUrl("play_list/admin/delete?id={$v.id}")}' class="btn btn-danger btn-xs deleteOne"><i class="icon-trash icon-white"></i>删除</a>
                  <a href='{AnUrl("play_list/admin/edit?id={$v.id}")}' class="btn btn-info btn-xs"><i class="icon-edit icon-white"></i>编辑</a>
                  <a href='{AnUrl("play_list/admin/add_material?id={$v.id}")}' class="btn btn-success btn-xs">添加素材</a>
                {else}
                  <a href='{AnUrl("play_list/admin/change_status?status=1")}' class="btn btn-success btn-xs changeStatus"><i class="icon-trash icon-white"></i>恢复</a>
                {/if}
              </td>
          </tr>
        {foreachelse}
          <tr>
              <td colspan='5'>暂无数据</td>
          </tr>
        {/foreach}
        {if $status}
          <tfoot><tr><td colspan="8"><input type="checkbox" class="selectAll"><a href="{AnUrl('play_list/admin/delete')}" class="btn btn-danger btn-xs deleteAll">批量删除</a></td></tr></tfoot>
        {/if}
    </tbody>
  </table>
  {include_core file="admin/lib/pager.html"}
<script>
$(function(){
  // 高级搜索时间验证
  $('.js_searchBtn').click(function(e){
    e.preventDefault();
    var thisObj   = $(this);
    var startDate = $.trim($('#startDate').val());
    var stopDate  = $.trim($('#stopDate').val());
    if (startDate > stopDate) {
      showMsg('结束时间应大于等于开始时间');
      return;
    }
    thisObj.closest('form').submit();
  });
});
</script>
{include_core file="admin/lib/footer.html"}